/* 基础样式 */
.App {
  text-align: center;
}

/* 刘海屏适配 - 安全区域支持 */
.safe-area-container {
  /* iOS 安全区域 */
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
  
  /* Android 刘海屏适配 */
  padding-top: max(env(safe-area-inset-top), 24px);
  
  /* 确保内容不被刘海遮挡 */
  min-height: 100vh;
  min-height: calc(100vh - env(safe-area-inset-top) - env(safe-area-inset-bottom));
}

/* 头部安全区域适配 */
.safe-area-header {
  padding-top: env(safe-area-inset-top);
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 1000;
}

/* 移动端头部刘海屏适配 */
.mobile-header-safe {
  padding-top: max(env(safe-area-inset-top), 0px) !important;
  padding-left: max(env(safe-area-inset-left), 12px) !important;
  padding-right: max(env(safe-area-inset-right), 12px) !important;
}

/* 内容区域安全适配 */
.safe-area-content {
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
  margin-bottom: env(safe-area-inset-bottom);
}

/* 底部安全区域适配 */
.safe-area-footer {
  padding-bottom: max(env(safe-area-inset-bottom), 16px);
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

.App-logo {
  height: 40vmin;
  pointer-events: none;
}

@media (prefers-reduced-motion: no-preference) {
  .App-logo {
    animation: App-logo-spin infinite 20s linear;
  }
}

.App-header {
  background-color: #282c34;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: calc(10px + 2vmin);
  color: white;
}

.App-link {
  color: #61dafb;
}

@keyframes App-logo-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* 响应式布局样式 */
.responsive-layout {
  min-height: 100vh;
}

/* 移动端侧边栏优化 */
.mobile-sider {
  position: fixed !important;
  left: 0;
  top: 0;
  bottom: 0;
  z-index: 1000;
  box-shadow: 2px 0 8px rgba(0, 0, 0, 0.15);
}

.mobile-sider-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 999;
}

/* 移动端内容区域 */
.mobile-content {
  margin-left: 0 !important;
  transition: margin-left 0.2s;
}

/* 移动端头部优化 */
.mobile-header {
  padding: 0 12px !important;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  /* 刘海屏适配 */
  padding-top: max(env(safe-area-inset-top), 0px) !important;
  padding-left: max(env(safe-area-inset-left), 12px) !important;
  padding-right: max(env(safe-area-inset-right), 12px) !important;
}

.mobile-header h2 {
  font-size: 16px !important;
  margin: 0;
}

/* 移动端内容区域 */
.mobile-content-inner {
  padding: 2px !important;
  margin: 0 !important;
}

/* 移动端卡片优化 */
.mobile-card {
  margin-bottom: 12px !important;
}

.mobile-card .ant-card-head {
  padding: 12px 16px !important;
  min-height: auto !important;
}

.mobile-card .ant-card-head-title {
  font-size: 16px !important;
  font-weight: 500;
}

.mobile-card .ant-card-body {
  padding: 16px !important;
}

/* 移动端表格优化 */
.mobile-table {
  overflow-x: auto;
}

.mobile-table .ant-table {
  min-width: 600px;
}

.mobile-table .ant-table-thead > tr > th {
  font-size: 12px !important;
  padding: 8px 4px !important;
}

.mobile-table .ant-table-tbody > tr > td {
  font-size: 12px !important;
  padding: 8px 4px !important;
}

/* 移动端表单优化 */
.mobile-form .ant-form-item {
  margin-bottom: 16px !important;
}

.mobile-form .ant-form-item-label {
  padding-bottom: 4px !important;
}

.mobile-form .ant-form-item-label > label {
  font-size: 14px !important;
}

.mobile-form .ant-input,
.mobile-form .ant-select-selector,
.mobile-form .ant-picker {
  font-size: 16px !important; /* 防止iOS缩放 */
  height: 40px !important;
}

/* 移动端按钮优化 */
.mobile-buttons .ant-btn {
  height: 40px !important;
  font-size: 14px !important;
  margin: 4px !important;
}

.mobile-buttons .ant-space {
  width: 100%;
  justify-content: center;
}

/* 移动端步骤条优化 */
.mobile-steps .ant-steps {
  overflow-x: auto;
  padding-bottom: 8px;
}

.mobile-steps .ant-steps-item {
  min-width: 120px;
}

.mobile-steps .ant-steps-item-title {
  font-size: 12px !important;
}

.mobile-steps .ant-steps-item-description {
  font-size: 11px !important;
}

/* 移动端选项卡优化 */
.mobile-tabs .ant-tabs-tab {
  font-size: 14px !important;
  padding: 8px 12px !important;
}

.mobile-tabs .ant-tabs-content {
  padding: 16px 0 !important;
}

/* 移动端统计卡片优化 */
.mobile-stats .ant-col {
  margin-bottom: 12px;
}

.mobile-stats .ant-card {
  text-align: center;
}

.mobile-stats .ant-card h2 {
  font-size: 20px !important;
  margin: 8px 0 !important;
}

/* 移动端进度条优化 */
.mobile-progress .ant-progress {
  margin-bottom: 12px !important;
}

.mobile-progress .ant-progress-circle {
  margin: 8px !important;
}

/* 移动端模态框优化 */
.mobile-modal .ant-modal {
  margin: 0 !important;
  max-width: calc(100vw - 16px) !important;
  top: 20px !important;
}

.mobile-modal .ant-modal-content {
  border-radius: 8px !important;
}

.mobile-modal .ant-modal-header {
  padding: 16px 20px 12px !important;
}

.mobile-modal .ant-modal-body {
  padding: 12px 20px !important;
}

.mobile-modal .ant-modal-footer {
  padding: 12px 20px 16px !important;
}

/* 移动端菜单按钮 - 已移到header内部 */

/* 平板端优化 */
@media (max-width: 1024px) and (min-width: 769px) {
  .ant-layout-sider {
    width: 180px !important;
    min-width: 180px !important;
    max-width: 180px !important;
  }
  
  .ant-layout-content {
    margin: 0 !important;
  }
  
  .ant-card {
    margin-bottom: 16px;
  }
  
  .ant-col {
    margin-bottom: 16px;
  }
}

/* 移动端响应式 */
@media (max-width: 768px) {
  /* 隐藏默认侧边栏 */
  .ant-layout-sider {
    display: none !important;
  }
  
  /* 移动端菜单按钮已移到header内部 */
  
  /* 移动端布局调整 */
  .ant-layout {
    margin-left: 0 !important;
  }
  
  .ant-layout-header {
    padding: 0 12px !important;
    height: 56px !important;
    line-height: 56px !important;
    /* 刘海屏适配 */
    padding-top: max(env(safe-area-inset-top), 0px) !important;
    padding-left: max(env(safe-area-inset-left), 12px) !important;
    padding-right: max(env(safe-area-inset-right), 12px) !important;
    height: calc(56px + max(env(safe-area-inset-top), 0px)) !important;
  }
  
  .ant-layout-content {
    margin: 0 !important;
    /* 刘海屏适配 */
    margin-left: max(env(safe-area-inset-left), 0px) !important;
    margin-right: max(env(safe-area-inset-right), 0px) !important;
  }
  
  .ant-layout-footer {
    padding: 16px 12px !important;
    font-size: 12px !important;
    /* 刘海屏适配 */
    padding-bottom: max(env(safe-area-inset-bottom), 16px) !important;
    padding-left: max(env(safe-area-inset-left), 12px) !important;
    padding-right: max(env(safe-area-inset-right), 12px) !important;
  }
  
  /* 移动端网格系统 */
  .ant-row .ant-col {
    margin-bottom: 12px;
  }
  
  /* 强制单列布局 */
  .mobile-single-column .ant-col {
    width: 100% !important;
    flex: 0 0 100% !important;
    max-width: 100% !important;
  }
  
  /* 移动端文字大小调整 */
  h1 { font-size: 20px !important; }
  h2 { font-size: 18px !important; }
  h3 { font-size: 16px !important; }
  h4 { font-size: 14px !important; }
  
  /* 移动端间距调整 */
  .ant-space {
    gap: 8px !important;
  }
  
  .ant-divider {
    margin: 16px 0 !important;
  }
}

/* 小屏幕移动端 */
@media (max-width: 480px) {
  .ant-layout-header h2 {
    font-size: 14px !important;
  }
  
  .ant-card-head-title {
    font-size: 14px !important;
  }
  
  .ant-btn {
    height: 36px !important;
    font-size: 13px !important;
  }
  
  .ant-input,
  .ant-select-selector {
    font-size: 16px !important; /* 防止iOS缩放 */
  }
  
  .mobile-single-column .ant-col {
    padding: 0 4px !important;
  }
}

/* 横屏模式优化 */
@media (max-height: 500px) and (orientation: landscape) {
  .ant-layout-header {
    height: 48px !important;
    line-height: 48px !important;
  }
  
  .ant-layout-content {
    margin: 0 !important;
  }
  
  .ant-card {
    margin-bottom: 8px !important;
  }
  
  .ant-card-body {
    padding: 12px !important;
  }
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
  .ant-btn,
  .ant-menu-item,
  .ant-tabs-tab {
    min-height: 44px !important; /* 符合触摸标准 */
  }
  
  .ant-table-tbody > tr > td {
    padding: 12px 8px !important;
  }
}

/* 高DPI屏幕优化 */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .ant-btn,
  .ant-input,
  .ant-select-selector {
    border-width: 0.5px !important;
  }
}

/* 暗色模式支持 */
@media (prefers-color-scheme: dark) {
  .mobile-menu-button {
    background: #177ddc;
  }
  
  .mobile-sider-overlay {
    background: rgba(0, 0, 0, 0.65);
  }
}
